package com.woniuxy;

import java.util.Objects;

/**
 * @author 作者
 * @create 2025-09-11 16:31
 */
public class Book  implements Comparable<Book> {
    private Integer bid;
    private String bname;
    private Integer price;

    public Book() {
    }

    public Book(Integer bid, String bname, Integer price) {
        this.bid = bid;
        this.bname = bname;
        this.price = price;
    }

    public Integer getBid() {
        return bid;
    }

    public void setBid(Integer bid) {
        this.bid = bid;
    }

    public String getBname() {
        return bname;
    }

    public void setBname(String bname) {
        this.bname = bname;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bid=" + bid +
                ", bname='" + bname + '\'' +
                ", price=" + price +
                '}';
    }


    @Override
    public int compareTo(Book o) {
        return price.compareTo(o.getPrice());
    }
}
